<template>
	<view class="grid col-1 grid-square">
		<view class="bg-img flex align-end" :style="[{ backgroundImage:'url(' + bgimg + ')' }]">
			<image :src="bgimg" style="width:0px;height:0px;" @error="errImg()" />
			<slot></slot>
		</view>
	</view>
</template>

<script>
	import Vue from 'vue'
	export default {
		data() {
			return {
				bgimg:'',
			};
		},
		name: 'bg-img',
		props: {
			img: {
				type: String,
				default: ''
			},
		},
		created() {
			this.bgimg=this.img
		},
		methods: {
			errImg(){
				this.bgimg="/static/img_err.png"
			}
		}
	};
</script>